<div class="page-title clearfix">
  <div class="title">Supplier管理</div>
  <button nz-button class="fr btn-green" [routerLink]="routerLinks.supplier.add" title="{{'Btn0003'| translate}}"><i
    class="anticon anticon-plus"></i>
    {{'Btn0003'| translate}}
  </button>
</div>

<div class="panel panel-body">
  <!--搜索 start-->
  <form nz-form (submit)="querySupplierList(1)">
    <div class="search-group">
      <span class="search-title">supplier名：</span>
      <div class="search-main">
        <input nz-input name="name"
               [(ngModel)]="searchParams.name"
               placeholder="{{'Supplier0001'| translate}}">
      </div>
    </div>
    <div class="inline-block">
      <button nz-button class="ml-20 mr" [nzType]="'primary'" title="{{'Btn0001'| translate}}" type="submit">
        <i class="anticon anticon-search"></i><span>{{"Btn0001"| translate}}</span>
      </button>
      <button nz-button class="mr" title="{{'Btn0002'| translate}}" type="reset" (click)="resetSearch()">
        <i class="anticon anticon-sync"></i><span>{{"Btn0002"| translate}}</span>
      </button>
    </div>
  </form>
  <!--搜索 end-->
</div>
<div class="panel">
  <nz-table #nzTable
            [nzData]="supplierList.voList"
            [nzLoading]="_loading"
            [nzFrontPagination]="false"
            [nzShowTotal]="totalRow"
            [nzPageSize]="supplierList.pageSize"
            [nzTotal]="supplierList.totalRow"
            [nzPageIndex]="supplierList.curPage"
            (nzPageIndexChange)="querySupplierList($event)">
    <thead nz-thead>
    <ng-template #totalRow>{{'Th0000' | translate : {totalRow: supplierList.totalRow} }}</ng-template>
    <tr>
      <th nz-th class="text-center" nzWidth=""><span>{{'Th0001' | translate}}</span></th><!--序号-->
      <th nz-th class="text-center" nzWidth=""><span>供应商名</span></th><!--供应商名称 最长32个汉字 64个英文-->
      <th nz-th class="text-center" nzWidth=""><span> 英文名</span></th><!--英文名-->
      <th nz-th class="text-center" nzWidth=""><span> 联系人</span></th><!--联系人-->
      <th nz-th class="text-center" nzWidth=""><span>最长32</span></th><!--最长32个汉字 64个英文-->
      <th nz-th class="text-center" nzWidth=""><span>开户行账</span></th><!--开户行账户-->
      <th nz-th class="text-center" nzWidth=""><span>支付方式</span></th><!--支付方式 -->
      <th nz-th class="text-center" nzWidth=""><span> 信用等级</span></th><!--信用等级-->
      <th nz-th class="text-center" nzWidth=""><span>供应商类</span></th><!--供应商类型编码-->
      <th nz-th class="text-center" nzWidth=""><span> 公司官网</span></th><!--公司官网-->
      <th nz-th class="text-center" nzWidth=""><span>地址 6</span></th><!--地址 64个汉字，128个英文字符-->
      <th nz-th class="text-center" nzWidth=""><span> 英文地址</span></th><!--英文地址-->
      <th nz-th class="text-center" nzWidth=""><span> 电子邮箱</span></th><!--电子邮箱-->
      <th nz-th class="text-center" nzWidth=""><span> 传真号</span></th><!--传真号-->
      <th nz-th class="text-center" nzWidth=""><span> 移动电话</span></th><!--移动电话-->
      <th nz-th class="text-center" nzWidth=""><span> 固定电话</span></th><!--固定电话-->
      <th nz-th class="text-center" nzWidth=""><span> 邮编</span></th><!--邮编-->
      <th nz-th class="text-center" nzWidth=""><span>公司性质</span></th><!--公司性质 国营 state_run ,民营privately operated，合资joint venture，外资 foreign capital-->
      <th nz-th class="text-center" nzWidth=""><span>状态：启</span></th><!--状态：启用 enable,禁用 disable 
            -->
      <th nz-th class="text-center" nzWidth=""><span> 创建时间</span></th><!--创建时间-->
      <th nz-th class="text-center" nzWidth=""><span>{{'Th0003' | translate}}</span></th><!--状态-->
      <th nz-th class="text-center" nzWidth=""><span>{{'Th0006' | translate}}</span></th><!--操作-->
    </tr>
    </thead>
    <tbody nz-tbody>
    <ng-template ngFor let-data [ngForOf]="nzTable.data" let-i="index">
      <tr nz-tbody-tr>
        <td nz-td class="text-center">{{i+1}}</td>
        <td nz-td class="text-center">{{data.name}}</td>
        <td nz-td class="text-center">{{data.englishName}}</td>
        <td nz-td class="text-center">{{data.contacts}}</td>
        <td nz-td class="text-center">{{data.bank}}</td>
        <td nz-td class="text-center">{{data.bankAccount}}</td>
        <td nz-td class="text-center">{{data.paymentTerm}}</td>
        <td nz-td class="text-center">{{data.creditRating}}</td>
        <td nz-td class="text-center">{{data.supplierCategoryCode}}</td>
        <td nz-td class="text-center">{{data.website}}</td>
        <td nz-td class="text-center">{{data.address}}</td>
        <td nz-td class="text-center">{{data.englishAddress}}</td>
        <td nz-td class="text-center">{{data.email}}</td>
        <td nz-td class="text-center">{{data.fax}}</td>
        <td nz-td class="text-center">{{data.mobile}}</td>
        <td nz-td class="text-center">{{data.telephone}}</td>
        <td nz-td class="text-center">{{data.zipCode}}</td>
        <td nz-td class="text-center">{{data.companyNature}}</td>
        <td nz-td class="text-center">{{data.state}}</td>
        <td nz-td class="text-center">{{data.createTime}}</td>
        <td nz-td class="text-center">
          <nz-switch class="thc" [ngModel]="data.state === states.enable" [ngModelOptions]="{standalone: true}"
                     nzCheckedChildren="是" nzUnCheckedChildren="否"
                     (ngModelChange)="modifySupplierState(data.code, $event)">
          </nz-switch>
        </td>
        <td nz-td class="text-center">
          <button nz-button class="btn-blue-o mr" [routerLink]="[routerLinks.supplier.modify,data.code]"
                  title="{{'Btn0004'| translate}}">
            <i class="anticon anticon-edit"></i></button>
          <button nz-button class="btn-success-o" [routerLink]="[routerLinks.supplier.detail,data.code]"
                  title="{{'Btn0005'| translate}}">
            <i class="anticon anticon-eye-o"></i></button>
        </td>
      </tr>
    </ng-template>
    </tbody>
  </nz-table>
</div>
